<?php
/*
 * File name:restaurent.php
 * Create by DucNN
 * Create date: 29/10/2012
 */
class Restaurent extends DataMapper {  
     public $has_many = array(
        'restaurentmeta' => array("restaurentmeta"),
        'term_taxonomy' => array(			
            'class' => 'term_taxonomy',			
            'other_field' => 'restaurent',		
            'join_self_as' => 'restaurent',		
            'join_other_as' => 'term_taxonomy',		
            'join_table' => 'hd_term_taxonomies_restaurents'
        )	
    );
    public function __construct()
    {
        // model constructor
        parent::__construct();
    }  
    function get_restaurentmeta($restaurent_id,$meta_key = '')
    {
        $res_meta = new Restaurentmeta();
        $res_meta->where('restaurent_id', $restaurent_id)
                ->where('meta_key', $meta_key)
                ->get();
        return $res_meta->meta_value;
    } 
}
?>